<template>
  <div class="container">
    <van-row>
      <van-col span="18" class="matr">
        <div class="name">{{value.materialName}}</div>
        <div class="spec">{{value.materialSpec}}</div>
        <div class="lot">
          {{value.lot}}<span class="exp">Exp</span>{{value.expiredDate | formatDate("yyyy-MM-dd")}}
        </div>
      </van-col>
      <van-col span="6"  class="matr">
        <div class="qty">.</div>
        <div class="qty"> {{value.qty/value.orderQty}} {{value.orderUnit}}  ( {{value.qty}} {{value.unit}})</div>
        <div class="price">￥ {{value.subtotalAmount}}</div>
      </van-col>
    </van-row>
  </div>
</template>
<script>
/* eslint-disable*/
export default {
  data() {
    return {
    }
  },
  props: {
    value: Object
  },
  components: {
  },
  computed: {
    cpSN() {
      const sns = this.value.sns || []
      if (sns.length > 0) {
        if (sns.length > 1) {
          return `${sns[0]} - ${sns[sns.length - 1]} 共 ${sns.length} 个`
        } else {
          return sns[0]
        }
      }
      return ''
    }
  },
  methods: {
  },
  mounted() {
  }
}
</script>
<style lang="scss" scoped>
  $line-height:25px;
  .container {
    background-color: white;
    padding:5px;
    border-radius: 5px;
  }
  .img-container {
    height: 75px;
    display: flex;
    align-items: center;
  }
  .matr-img {
    border:0;
    width:64px;
    height:64px;
  }
  .matr {
    line-height: $line-height;
    text-align: left;
    font-size: 12px;
    text-overflow:ellipsis;//文字隐藏后添加省略号
    white-space:nowrap;//强制不换行
    .spec, .lot {
      color:#2f2f2f;
    }
    .name {
      font-weight: bold;
      color:#1f1f1f;
    }
    .qty {
      color:#2f2f2f;
      text-align: right;
    }
    .price {
      color:#2f2f2f;
      text-align: right;
    }
  }
  .exp {
    font-size: 8px;
    background-color: lightgreen;
    color: white;
    padding: 2px;
    margin:5px;
  }
  .sn {
    border-top: 1px solid lightgray;
    text-align: center;
    padding-top:2px;
    height:20px;
    font-size: 9px;
    margin-top: 5px;
  }

  .my-swipe .van-swipe-item {
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
    background-color: #39a9ed;
  }
</style>
